package com.iqismart.shorturl.utils;

import org.springframework.util.DigestUtils;

/**
 * @Description
 * @Auther sty
 * @createTime 2019-10-16 16:14
 */
public class PasswordEncoder {
    public static String encode(String password){
        return DigestUtils.md5DigestAsHex(password.getBytes());
    }

    public static boolean pass(String password,String passwordEncoded){
        if(DigestUtils.md5DigestAsHex(password.getBytes()).equals(passwordEncoded)){
            return true;
        }else{
            return false;
        }
    }
}
